<?php
class GoodsModule extends WebModule {
	public function init() {
		if (empty(Yii::app()->adminUser->worker->info)) {
			return ;
		}
		$itemId = CHtml::value(Yii::app()->adminUser,'worker.info.category_id');
		
		$goodsTypes = array(
			Goods::TYPE_TRAVEL => 'travel',
			Goods::TYPE_HOTEL => 'hotel',
			Goods::TYPE_SCENIC => 'scenic',
			Goods::TYPE_NATIVE => 'native',
			Goods::TYPE_TICKET => 'ticket',
		);
		$this->defaultController = isset($goodsTypes[$itemId]) ? $goodsTypes[$itemId] : 'goods';
	}
}
?>